<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>医院就诊挂号系统</title>
<style type="text/css">
	form{
		padding: 20px;
	}
</style>
</head>
<body>
	<h1 align="center">医院就诊挂号系统</h1>
	<form action="list.do">
		患者姓名：<input type="text" name="name">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		医师类别：
				<select name="type">
					<option value="" >=不限=</option>
					<option value="专家医师" >专家医师</option>
					<option value="普通医师" >普通医师</option>
					<option value="副主任医师" >副主任医师</option>
				</select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		科室：<input type="text" name="dep">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="submit" value="查询">&nbsp;&nbsp;&nbsp;
		<input type="button" value="挂号" onclick="add()">
	</form>
	<table style="margin-bottom: 30px;" width="100%" border="1px" cellpadding="11" cellspacing="0">
		<tr>
			<th>编号</th>
			<th>姓名</th>
			<th>性别</th>
			<th>年龄</th>
			<th>电话</th>
			<th>科室</th>
			<th>医师类别</th>
			<th>价格</th>
			<th>挂号时间</th>
			<th>状态</th>
			<th>操作</th>
		</tr>
		<c:forEach var="list" items="${selctAll }">
			<tr>
				<td>${list.id }</td>
				<td>${list.name }</td>
				<td>${list.sex }</td>
				<td>${list.age }</td>
				<td>${list.phone }</td>
				<td>${list.department }</td>
				<td>${list.type }</td>
				<td>${list.price }</td>
				<td><fmt:formatDate value="${list.registerTime }" pattern="yyyy-MM-dd"/></td>
				<td>
					<c:if test="${list.state==0}">
	 			    	未就诊
	 			    </c:if>
					<c:if test="${list.state==1}">
	 			    	已就诊
	 			    </c:if>
				</td>
				<td>
					<c:if test="${list.state==0}">
	 			    	<a href="javascript:if(confirm('确实要核销该挂号信息吗?'))location='upd.do?id=${list.id }'">核销</a>
	 			    </c:if>
					<%-- <c:if test="${list.state==1}">
	 			    	已就诊
	 			    </c:if> --%>
				</td>
			</tr>
		</c:forEach>
	</table>
	<script type="text/javascript">
	function add() {
		location.href="adds.do";
	}
	</script>
</body>
</html>